/**
 *
 * Licensed Materials - Property of IBM 
 * 
 * OCO Source Materials 
 * 
 * (C) Copyright IBM Corp. 2011, 2012 All Rights Reserved 
 * 
 * The source code for this program is not published or other- 
 * wise divested of its trade secrets, irrespective of what has 
 * been deposited with the U.S. Copyright Office. 
 *
 */

/**
 * CHANGE HiSTORY:
 * Author             Time                 Description
 *
 */
package com.ibm.ba.demo.service;

import java.util.List;

import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.dao.DataAccessException;
import org.springframework.stereotype.Service;

import com.ibm.ba.demo.dao.ProductDao;
import com.ibm.ba.demo.entity.Product;
import com.ibm.ba.demo.entity.SPSSModelConfiguration;
import com.ibm.ba.demo.exception.GeneralException;
import com.ibm.ba.demo.helper.BeanHelper;

@Service
public class ProductService {

	private static Logger logger = Logger.getLogger(ProductService.class);

	@Autowired
	private ProductDao productDao;

	@Autowired
	private SPSSModelConfiguration config;

	public List<Product> getAllProducts() throws GeneralException {
		List<Product> productList = null;
		try {
			//productList = productDao.getAllProducts();
		} catch (DataAccessException e) {
			logger.error("ba.error.00007 - query failed", e);
			throw new GeneralException("ba.error.00007", e);
		} catch (Exception e) {
			logger.error("ba.error.00001 - query failed", e);
			throw new GeneralException("ba.error.00001", e);
		}
		logger.info("productList is: " + BeanHelper.beanToJson(productList));
		return productList;
	}

}
